package com.darrenchan.course05

import scala.collection.mutable.ArrayBuffer

object ArrayApp extends App {
  val aaa = new Array[String](3)
  val bbb = Array("hadoop", "spark", "flink") //apply()

//  println(bbb.length)

  println(bbb.mkString("<","-",">"))

  val ccc = new ArrayBuffer[Int]()
  println(ccc.length)

  ccc += 1
  ccc += 2
  ccc += (3, 4, 5)
  ccc ++= Array(6, 7, 8)

  println(ccc)

  println(ccc.max, ccc.min)

  ccc.insert(0, 9, 9, 9)
  println(ccc)

  ccc.remove(0, 1)
  println(ccc)

  ccc.trimEnd(2)
  println(ccc)

  ccc.toArray
}
